﻿using Huirui.Cavan.Domain.Seedwork;
using System;
using System.Collections;

namespace Huirui.Cavan.Domain.MainBoundedContext.SystemModule
{
    #region Subject

    /// <summary>
    /// Subject object for NHibernate mapped table 'Subject'.
    /// </summary>
    [Serializable]
    public class Subject : Persistent<string>
    {
        #region Member Variables

        protected string _name;
        protected int _foreignAccounting;
        protected int _type;
        protected int _balanceDirection;
        protected int _assistantAccounting;
        protected string _controlledSubjectCode;
        protected int _status;

        #endregion

        #region Constructors

        public Subject() { }

        public Subject(string name, int foreignAccounting, int type, int balanceDirection, int assistantAccounting, string controlledSubjectCode, int status, DateTime createDate, DateTime modifyDate, int editUser, byte[] version)
        {
            this._name = name;
            this._foreignAccounting = foreignAccounting;
            this._type = type;
            this._balanceDirection = balanceDirection;
            this._assistantAccounting = assistantAccounting;
            this._controlledSubjectCode = controlledSubjectCode;
            this._status = status;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._version = version;
        }

        #endregion

        #region Public Properties

        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Name", value, value.ToString());
                _name = value;
            }
        }

        public virtual int ForeignAccounting
        {
            get { return _foreignAccounting; }
            set { _foreignAccounting = value; }
        }

        public virtual int Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public virtual int BalanceDirection
        {
            get { return _balanceDirection; }
            set { _balanceDirection = value; }
        }

        public virtual int AssistantAccounting
        {
            get { return _assistantAccounting; }
            set { _assistantAccounting = value; }
        }

        public virtual string ControlledSubjectCode
        {
            get { return _controlledSubjectCode; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for ControlledSubjectCode", value, value.ToString());
                _controlledSubjectCode = value;
            }
        }

        public virtual int Status
        {
            get { return _status; }
            set { _status = value; }
        }



        #endregion
    }
    #endregion
}